import service from '@/utils/request';
// 添加一级分类

export function AddStore(data) {
  return service.request({
    method: 'post',
    url: '/warehouse/add.do',
    data
  })
}

export function GetStore() {
  return service.request({
    method: 'get',
    url: '/warehouse/findAll.do',
  })
}
// 修改仓库
export function UpdateStore(data) {
  return service.request({
    method: 'put',
    url: '/warehouse/update.do',
    data
  })
}
export function DelStore(data) {
  return service.request({
    method: 'get',
    url: '/warehouse/delete.do?warehouseId='+data,
  })
}
// 修改库区
export function UpdateArea(data) {
  return service.request({
    method: 'post',
    url: '/area/update.do',
    data
  })
}
// 添加库区
export function AddStoreArea(data) {
  return service.request({
    method: 'post',
    url: '/area/add.do',
    data
  })
}
// 删除库区
export function DelStoreArea(data) {
  return service.request({
    method: 'get',
    url: '/area/delete.do?areaId='+data,
  })
}
// 通过仓库ID查询库区
export function FindStoreArea(data) {
  return service.request({
    method: 'get',
    url: '/warehouse/findAllArea.do?warehouseId='+data,
  })
}
// 通过仓库ID查询库区和库位
export function GetAreaDepart(data) {
  return service.request({
    method: 'get',
    url: '/warehouse/findDepartById.do?warehouseId='+data,
  })
}
// 通过库区ID查询库位
export function FindAreaDepart(data) {
  return service.request({
    method: 'get',
    url: '/area/findDepartment.do?areaId='+data,
  })
}
// 添加库位
export function AddDepart(data) {
  return service.request({
    method: 'post',
    url: '/department/add.do',
    data
  })
}
// 修改库位
export function UpdateDepart(data) {
  return service.request({
    method: 'post',
    url: '/department/update.do',
    data
  })
}
// 删除库位
export function DelDepart(data) {
  return service.request({
    method: 'get',
    url: '/department/delete.do?departmentId='+data,
  })
}

// 展示库位库存
export function GetDepartStock(data) {
  return service.request({
    method: 'get',
    url: '/corder/findStockByProdDepart?prodDepart='+data.prodDepart+'&prodArea='+data.prodArea+'&warehouseId='+data.warehouseId,
  })
}
// 展示库区库存
export function GetAreaStock(data) {
  return service.request({
    method: 'get',
    url: '/corder/findStockByProdArea?prodArea='+data.prodArea+'&warehouseId='+data.warehouseId,
  })
}
// 展示仓库库存
export function GetStoreStock(data) {
  return service.request({
    method: 'get',
    url: '/corder/findStockByWarehouseId?warehouoseId='+data,
  })
}